import { NgModule } from '@angular/core'
import { Routes, RouterModule } from '@angular/router'
import { AcquirerListComponent } from './list/list.component'
import { AcquirerNewComponent } from './new/new.component'
import { NewRouterGuardClass } from '@shared/classes/NewRouterGuardClass'
import { AcquirerDetailComponent } from './detail/detail.component'
import { AcquirerDetailTabTradesComponent } from './detail/tab-trades/tab-trades.component'

import { AcquirerDetailTabUsersComponent } from './detail/tab-users/tab-users.component'
import { AcquirerDetailTabChannelCardComponent } from './detail/tab-channel-card/tab-channel-card.component'
import { AcquirerDetailTabChannelQrComponent } from './detail/tab-channel-qr/tab-channel-qr.component'
import { AcquirerDetailTabChannelEcComponent } from './detail/tab-channel-ec/tab-channel-ec.component'
import { AcquirerDetailTabSettlementComponent } from './detail/tab-settlement/tab-settlement.component'
import { AcquirerDetailTabAuditComponent } from './detail/tab-audit/tab-audit.component'
import { AcquirerDetailTabFuncQrComponent } from './detail/tab-func-qr/tab-func-qr.component'
import { AcquirerDetailTabFuncCardComponent } from './detail/tab-func-card/tab-func-card.component'
import { AcquirerAddQrChannelComponent } from './add/qr-channel/qr-channel.component'
import { AcquirerAddEcChannelComponent } from './add/ec-channel/ec-channel.component'
import { AcquirerAddTradeComponent } from './add/trade/trade.component'
import { AcquirerAddCardChannelComponent } from './add/card-channel/card-channel.component'
import { AcquirerDetailTabFuncAcquirerComponent } from './detail/tab-func-acquirer/tab-func-acquirer.component'
import { ListRouterGuardClass } from '@shared/classes/ListRouterGuardClass'
import { ListReuseGuardClass } from '@shared/classes/ListReuseGuardClass';

const routes: Routes = [
  { path: '', redirectTo: 'list', pathMatch: 'full' },
  {
    path: 'list',
    component: AcquirerListComponent,
    canActivate: [ListRouterGuardClass, ListReuseGuardClass],
    pathMatch: 'full',
    data: {
      title: 'Acquirers',
      titleI18n: 'MENU.BIZ.INSTITUTIONS',
      reuse: true,
    },
  },
  {
    path: 'new',
    component: AcquirerNewComponent,
    canDeactivate: [NewRouterGuardClass],
    data: {
      breadcrumb: 'GENERAL.INFO.BREADCRUMB.CREATE',
      title: 'Create Acquirer',
      titleI18n: 'BIZ.ACQUIRER.TITLE.CREATE',
    },
  },
  {
    path: ':id',
    component: AcquirerDetailComponent,
    children: [
      { path: '', redirectTo: 'trades', pathMatch: 'full' },
      {
        path: 'trades',
        component: AcquirerDetailTabTradesComponent,
        data: {
          titleI18n: 'BIZ.ACQUIRER.TITLE.DETAIL',
        },
      },
      {
        path: 'channels/qr',
        component: AcquirerDetailTabChannelQrComponent,
        data: {
          titleI18n: 'BIZ.ACQUIRER.TITLE.DETAIL',
        },
      },
      {
        path: 'channels/card',
        component: AcquirerDetailTabChannelCardComponent,
        data: {
          titleI18n: 'BIZ.ACQUIRER.TITLE.DETAIL',
        },
      },
      {
        path: 'channels/ec',
        component: AcquirerDetailTabChannelEcComponent,
        data: {
          titleI18n: 'BIZ.ACQUIRER.TITLE.DETAIL',
        },
      },
      {
        path: 'settlement',
        component: AcquirerDetailTabSettlementComponent,
        data: {
          titleI18n: 'BIZ.ACQUIRER.TITLE.DETAIL',
        },
      },
      {
        path: 'audit',
        component: AcquirerDetailTabAuditComponent,
        data: {
          titleI18n: 'BIZ.ACQUIRER.TITLE.DETAIL',
        },
      },
      {
        path: 'users',
        component: AcquirerDetailTabUsersComponent,
        data: {
          titleI18n: 'BIZ.ACQUIRER.TITLE.DETAIL',
        },
      },
      {
        path: 'func/qr',
        component: AcquirerDetailTabFuncQrComponent,
        data: {
          titleI18n: 'BIZ.ACQUIRER.TITLE.DETAIL',
        },
      },
      {
        path: 'func/card',
        component: AcquirerDetailTabFuncCardComponent,
        data: {
          titleI18n: 'BIZ.ACQUIRER.TITLE.DETAIL',
        },
      },
      {
        path: 'func/acquirer',
        component: AcquirerDetailTabFuncAcquirerComponent,
        data: {
          titleI18n: 'BIZ.ACQUIRER.TITLE.DETAIL',
        },
      },
    ],
    data: {
      breadcrumb: 'GENERAL.INFO.BREADCRUMB.DETAIL',
      title: 'Acquirer Detail',
      titleI18n: 'BIZ.ACQUIRER.TITLE.DETAIL',
    },
  },
  {
    path: ':id/qr/add',
    component: AcquirerAddQrChannelComponent,
    data: {
      breadcrumb: 'BIZ.ACQUIRER.TITLE.ADD_CHANNEL',
      titleI18n: 'BIZ.ACQUIRER.TITLE.ADD_CHANNEL',
    },
  },
  {
    path: ':id/card/add',
    component: AcquirerAddCardChannelComponent,
    data: {
      breadcrumb: 'BIZ.ACQUIRER.TITLE.ADD_CHANNEL',
      titleI18n: 'BIZ.ACQUIRER.TITLE.ADD_CHANNEL',
    },
  },
  {
    path: ':id/ec/add',
    component: AcquirerAddEcChannelComponent,
    data: {
      breadcrumb: 'BIZ.ACQUIRER.TITLE.ADD_CHANNEL',
      titleI18n: 'BIZ.ACQUIRER.TITLE.ADD_CHANNEL',
    },
  },
  {
    path: ':id/trades/edit',
    component: AcquirerAddTradeComponent,
    data: {
      breadcrumb: 'BIZ.ACQUIRER.TITLE.EDIT_TRADE',
      titleI18n: 'BIZ.ACQUIRER.TITLE.EDIT_TRADE',
    },
  },
]

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class AcquirerRoutingModule {}
